<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo $headConf['title']?></title>
    <link rel="icon" type="text/css" href="../../../Public/Home/icon.ico" />
    <?php foreach($headConf['css'] as $k=>$v){ ?>
    <link rel="stylesheet" type="text/css" href="/c73/php_beijing/mall/Public/Home/css/<?php echo ($v); ?>.css" />
    <?php } ?>
    <!--用js变量存储购物车异步请求地址-->
    <script>
//        ajax异步请求更新购物车,声明变量以便在js文件中使用
        var ajaxUpdateCart = "<?php echo u('cart/ajaxUpdateCart');?>";
//        ajax异步请求删除购物车中的一条数据，声明变量以便在js文件中使用
        var ajaxDelCartGoods = "<?php echo u('cart/ajaxDelCartGoods');?>";
//        ajax异步请求修改默认地址，声明变量以便在js文件中使用
        var ajaxUpdateSelectedAd = "<?php echo u('order/ajaxUpdateSelectedAd');?>";
//        ajax异步请求删除默认地址，声明变量以便在js文件中使用
        var ajaxDelAddress = "<?php echo u('order/ajaxDelAddress');?>";
    </script>
    <script src="/c73/php_beijing/mall/Public/Home/js/jquery-1.10.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/c73/php_beijing/mall/Public/Home/layer/layer.js"></script>
    <?php foreach($headConf['js'] as $k=>$v){ ?>
    <script src="/c73/php_beijing/mall/Public/Home/js/<?php echo $v ?>.js" type="text/javascript" charset="utf-8"></script>
    <?php } ?>
</head>
<body>
<!--头部开始-->
<div id="top">
    <!--头部灰条就开始-->
    <div class="topbox">
        <div class="main">
            <div class="topleft fl">
                <a href="javascript:;">欢迎来到冰雨商城</a>

            </div>
            <div class="topright fr">
                <div class="login fl">
                    <?php if(!session('home.uid')){ ?>
                    <a href="<?php echo U('user/login');?>">登录</a>
                    <a href="<?php echo U('user/reg');?>">注册</a>
                    <?php }else{ ?>
                    <a href="<?php echo u('order/index');?>" style="color:#fff">欢迎您 <?php echo session('home.username');?></a>
                    <a href="<?php echo U('user/loginOut');?>">退出</a>
                    <?php }?>
                </div>
                <span class="fl">|</span>
                <div class="fcode fl">

                    <a href="<?php echo u('order/index');?>">我的订单</a>
                </div>
            </div>
        </div>
    </div>
    <!--头部灰条结束-->

    <!--logo区域开始-->
    <div class="logoRegion">
        <div class="main">
            <div class="logo">
                <a href="<?php echo U('home/index/index');?>"><img src="/c73/php_beijing/mall/Public/Home/images/360logo.png"/></a>
            </div>
            <div class="seachRegion">
                <div class="seach fl">
                    <form action="" method="post">
                        <input type="text" class="seachtxt fl" value="O2+车载空气净化" />
                        <input type="submit" class="btn" value="" />
                    </form>
                    <p class="searchkey">
                        <a href="">电竞配件低至5折</a>
                        <a href="">电竞配件低至5折</a>
                        <a href="">电竞配件低至5折</a>
                    </p>

                </div>
                <style>
                    .cart-tips ul {
                        padding:10px 20px;
                        overflow: hidden;
                    }
                    .cart-tips ul li{
                        overflow: hidden;
                        height:70px;
                        line-height:70px;
                        border-bottom: 1px solid #ccc;
                    }
                    .cart-tips ul li:last-child{
                        border:none;
                    }
                    .cart-tips  .pic {
                        float: left;
                    }
                    .cart-tips  .title a{
                        float: left;
                        color:#666;
                        width:142px;
                        overflow: hidden;
                        white-space:nowrap;
                        text-overflow:ellipsis;
                        margin-left: 10px;
                    }
                    .cart-tips  .price_num{
                        float: left;
                        margin-left: 30px;
                    }
                    .cart-tips  .del{
                        color:#666;
                        float: right;
                    }
                </style>
                <script>
//                    在载入页面的时候出发异步请求，获取购物车中的数量
                    $(function(){
                        $.post("<?php echo U('cart/ajaxGetCartNum');?>",{},function(res){
                            if(res){
                                $('#cart_num').text(res);
                            }
                        },'json');
                    })
                </script>
                <div class="topshopcart fr">
                    <a href="<?php echo U('cart/index');?>" class="header-cart"><i></i>我的购物车<span class="cart-size">(<span id="cart_num">0</span>)</span></a>
                    <div class="cart-tips" style="height:auto;">
                        <ul>
                            <li style="text-align:center;">购物车中还没有商品~ 去 <a href="#" style="color:red;">购物</a></li>
                        </ul>
                    </div>
                </div>
                <script>
                    $(function(){
                        $('.header-cart').mouseenter(function(){
                            $.post("<?php echo u('cart/ajaxGetCartData');?>",{},function(res){
                                if(res){
                                    var str= '';
                                    $.each(res,function(k,v){
                                        str +=
                                            '<li>' +
                                            '<a href="<?php echo u('cart/index');?>" class="pic"><img src="/c73/php_beijing/mall/'+v.pic+'" width="50"></a>' +
                                            '<p class="title"><a href="<?php echo u('cart/index');?>">'+v.name+'</a></p>' +
                                            '<p class="price_num">'+v.price+' X'+v.num+'</p>' +
                                            '<a href="javascript:;" class="delCartData" ucid="'+v.ucid+'" sid="'+k+'">X</a>' +
                                            '</li>';
                                    })
                                    str = '<ul>'+str+'</ul>';
                                    $('.header-cart').siblings('.cart-tips').find('ul').replaceWith(str);
                                }
                            },'json');
                        })
                        $(document).on('click','.delCartData',function(){
                            var _this= $(this);
                            $.post("<?php echo U('cart/ajaxDelCartData');?>",{ucid:$(this).attr('ucid'),sid:$(this).attr('sid')},function(res){
                                if(res){
                                    _this.parent().remove();
                                }
                            },'json');
                        })
                    })
                </script>
            </div>

        </div>
    </div>
    <!--logo区域结束-->
    <!--导航开始-->
    <div class="navbox">
        <div class="main">
            <h5 class="fl"><a href=""><i></i>全部智能酷品</a></h5>
            <ul class="menu fl">
                <li class="menulist">
                    <a href="list.html">手机</a>
                    <div class="menuHiden">

                        <ul class="product">

                            <li>
                                <a href=""><img src="/c73/php_beijing/mall/Public/Home/images/right.png" alt="" /></li>
                            <li><img src="/c73/php_beijing/mall/Public/Home/images/right.png" alt="" /></a>
                            </li>
                            <li>
                                <a href=""><img src="/c73/php_beijing/mall/Public/Home/images/right.png" alt="" /></li>
                            <li><img src="/c73/php_beijing/mall/Public/Home/images/right.png" alt="" /></a>
                            </li>
                            <li>
                                <a href=""><img src="/c73/php_beijing/mall/Public/Home/images/right.png" alt="" /></li>
                            <li><img src="/c73/php_beijing/mall/Public/Home/images/right.png" alt="" /></a>
                            </li>

                        </ul>

                    </div>
                </li>

            </ul>

        </div>


        
</div>
<!--导航结束-->
<div class="clear"></div>

</div>
<!--头部结束-->
<script>
    $(function () {
        area.init('area');
        //默认选中效果
        area.selected('山西', '临汾', '尧都区');

    })
</script>
<!--中间开始-->
<div id="content">
    <div class="ordercontent main" style="height:auto">
        <div class="orderleft">
            <div class="ordertitle">
                <h1>个人中心</h1>
                <ul>
                    <li><a href="<?php echo u('index');?>">我的订单<span>&gt;</span></a></li>
                    <li><a href="<?php echo u('manageAddress');?>">管理地址<span>&gt;</span></a></li>
                </ul>
            </div>
        </div>
        <div class="orderright">
            <div class="orderlist">
                <h2>管理地址</h2>
                <div class="body-center" style="width:100%;margin:0">
                    <div class="center-content">
                        <!--地址选择开始-->
                        <div class="content-address">
                            <div class="addressList">
                                <?php if(is_array($addressData)): foreach($addressData as $k=>$v): ?><div class="consignee-item">
                                        <span class="radio-img <?php if($v['status']){ echo 'pitchOn';} ?> "></span>
                                        <label class="radio">
                                            <input type="radio" name="adress" class="radio-select" value=""/><span
                                                class="e-name"><?php echo ($v['ac_name']); ?></span>，<span
                                                class="city"><?php echo ($v['city']); ?> </span><span
                                                class="city-particular"><?php echo ($v['p_address']); ?></span>，<span
                                                class="codeNumber"><?php echo ($v['mobile']); ?></span>
                                            <input type="hidden" class="postCode" name="postCode"
                                                   value="<?php echo ($v['postcode']); ?>">
                                        </label>
                                        <span class="compile"><a class="del_address" href="javascript:;"
                                                                 aid="<?php echo ($v['aid']); ?>">删除</a></span>
                                        <span class="compile"><a class="copyreader" href="javascript:;"
                                                                 aid="<?php echo ($v['aid']); ?>">编辑&nbsp;&nbsp;</a></span>

                                    </div><?php endforeach; endif; ?>
                            </div>


                            <!--添加新地址-->

                            <div class="consignee-item new-ress addAdress_span">
                                <span class="radio-img pitchOn"></span>
                                <label for="adress3" class="radio"><input type="radio" name="adress" id="adress3"
                                                                          class="radio-select"
                                                                          value=""/>使用新地址</label>
                            </div>
                            <!--添加地址按钮-->
                            <a href="javascript:;" class="new-address"></a>
                            <!--添加地址框-->
                            <div class="add-address new addAddress_form">
                                <form action="" method="post">
                                    <div class="s-name">
                                        <h3 class="style"><b>*</b>收货人姓名</h3>
                                        <input type="text" class="public" name="ac_name" placeholder="收货人姓名" value=""/>
                                    </div>
                                    <div class="address-s">
                                        <h3 class="style"><b>*</b>地址</h3>

                                        <!--城市联动-->
                                        <select name="city[]" id="area1"></select>
                                        <select name="city[]" id="area2"></select>
                                        <select name="city[]" id="area3"></select>
                                        <!--<input type="text" name="name" id="name" placeholder="收货人姓名" value="" />-->
                                        <textarea name="p_address" placeholder="路名或街道地址，门牌号 " id="particular" rows=""
                                                  cols=""></textarea>
                                    </div>

                                    <div class="postcode">
                                        <h3 class="style"><b>&nbsp;</b>邮政编码</h3>
                                        <input type="text" class="public" name="postcode" id="postcode"
                                               placeholder="6位邮政编码" value=""/>
                                    </div>
                                    <div class="shouji">
                                        <h3 class="style"><b>*</b>手机号码 </h3>
                                        <input type="tel" class="public" name="mobile" id="shouji" placeholder="11位手机号码"
                                               value=""/>
                                    </div>
                                    <div class="btn-group">
                                        <input type="submit" class="btn" id="btn-bao" value="保存"/>
                                        <a href="javascript:;" class="btn-qu btn">取消</a>
                                    </div>
                                </form>
                                <script>
                                    $(function () {
                                        $('.new form').submit(function () {
                                            var data = $(this).serialize();
                                            $.post("<?php echo u('ajaxAddAddress');?>", data, function (res) {
                                                if (res) {
                                                    $('.addAdress_span,.addAddress_form').hide();
                                                    $('.new-address').show();
                                                    var html = '<div class="consignee-item">' +
                                                        '<span class="radio-img pitchOn"></span>' +
                                                        '<label class="radio">' +
                                                        '<input type="radio" name="adress" class="radio-select" value=""/><span class="e-name">' + res.ac_name + '</span>，<span class="city">' + res.city + '</span><span class="city-particular">' + res.p_address + '</span>，<span class="codeNumber">' + res.mobile + '</span>' +
                                                        '</label>' +
                                                        '<input type="hidden" class="postCode" name="postCode" value="' + res.postcode + '">' +
                                                        '<span class="compile"><a class="del_address" href="javascript:;" aid="' + res.aid + '">删除</a></span>' +
                                                        '<span class="compile"><a class="copyreader" href="javascript:;" aid="' + res.aid + '">编辑&nbsp;&nbsp;</a></span>' +
                                                        '</div>';
                                                    $(".addressList .consignee-item .radio-img").removeClass('pitchOn');
                                                    $('.addressList').append(html);
                                                } else {
                                                    layer.msg('请填入完整信息！');
                                                }
                                            }, 'json');
                                            return false;
                                        })
                                    })
                                </script>
                            </div>

                            <!--添加新地址结束-->
                            <!--编辑开始-->
                            <div class="add-address edit">
                                <form action="" method="post">
                                    <div class="s-name">
                                        <h3 class="style"><b>*</b>收货人姓名</h3>
                                        <input type="text" class="public" name="ac_name" id="name" placeholder="收货人姓名"
                                               value=""/>
                                    </div>
                                    <div class="address-s">
                                        <h3 class="style"><b>*</b>地址</h3>
                                        <!--城市联动-->
                                        <select name="city[]" id="area_1"></select>
                                        <select name="city[]" id="area_2"></select>
                                        <select name="city[]" id="area_3"></select>
                                        <!--<input type="text" name="name" id="name" placeholder="收货人姓名" value="" />-->
                                        <textarea name="p_address" placeholder="路名或街道地址，门牌号 " id="particular" rows=""
                                                  cols=""></textarea>
                                    </div>

                                    <div class="postcode">
                                        <h3 class="style"><b>&nbsp;</b>邮政编码</h3>
                                        <input type="text" class="public" name="postcode" id="postcode"
                                               placeholder="6位邮政编码" value=""/>
                                    </div>
                                    <div class="shouji">
                                        <h3 class="style"><b>*</b>手机号码 </h3>
                                        <input type="text" class="public" name="mobile" id="shouji"
                                               placeholder="11位手机号码" value=""/>
                                    </div>
                                    <div class="btn-group">
                                        <input type="hidden" id="aid" name="aid" value="1">
                                        <input type="submit" class="btn" id="btn-bao" value="保存"/>
                                        <a href="javascript:;" class="btn-qu btn">取消</a>
                                    </div>

                                </form>
                            </div>
                            <!--编辑结束-->
                            <script>
                                $(function () {
                                    $('.edit form').submit(function () {
                                        var data = $(this).serialize();
                                        console.log(data);
                                        $.post("<?php echo u('ajaxEditAddress');?>", data, function (res) {
                                            if (res) {
                                                var html = '<div class="consignee-item">' +
                                                    '<span class="radio-img pitchOn"></span>' +
                                                    '<label class="radio">' +
                                                    '<input type="radio" name="adress"  class="radio-select" value=""/><span class="e-name">' + res.ac_name + '</span>，<span class="city">' + res.city + '</span><span class="city-particular">' + res.p_address + '</span>，<span class="codeNumber">' + res.mobile + '</span>' +
                                                    '</label>' +
                                                    '<input type="hidden" class="postCode" name="postCode" value="' + res.postcode + '">' +
                                                    '<span class="compile"><a class="del_address" href="javascript:;" aid="' + res.aid + '">删除</a></span>' +
                                                    '<span class="compile"><a class="copyreader" href="javascript:;" aid="' + res.aid + '">编辑&nbsp;&nbsp;</a></span>' +
                                                    '</div>';
                                                $('.consignee-item .copyreader[aid=' + res.aid + ']').parents('.consignee-item').replaceWith(html);
                    //                              让其他兄弟元素的背景图消失
                                                $('.consignee-item').find('.radio-img').removeClass('pitchOn');
                //                                选中所编辑的地址
                                                $('.consignee-item .copyreader[aid=' + res.aid + ']').parents('.consignee-item').find('.radio-img').addClass('pitchOn');
                                                $('.edit').hide();
                                            } else {
                                                layer.msg('请填入完整信息！');
                                            }
                                        }, 'json');
                                        return false;
                                    })
                                })
                            </script>
                        </div>
                        <!--地址选择结束-->
                    </div>
                </div>


            </div>
        </div>
        <div style="clear:both"></div>
    </div>


</div>
</div>
<!--中间结束-->



        <!--尾部开始-->
        <div class="mod-footer">
            <div class="foot-bannerw">
                <div class="foot-banner clearfix">
                    <div class="banner-item">
                        <a href="#" target="_blank" data-monitor="home_foot_days7"><i class="icon1">7</i>7天无理由退货</a>
                    </div>
                    <div class="banner-item">
                        <a href="#" target="_blank" data-monitor="home_foot_days15"><i class="icon2">15</i>15天免费换货</a>
                    </div>
                    <div class="banner-item"><i class="icon3">包</i>满99元包邮</div>
                    <div class="banner-item">
                        <a href="#" target="_blank" data-monitor="home_foot_moblie"><i class="icon4">服</i>手机特色服务</a>
                    </div>
                </div>
            </div>
            <div class="foot-containerw">
                <div class="foot-container clearfix">
                    <dl class="foot-con"> <dt data-monitor="home_foot_freshman">帮助中心 </dt>
                        <dd data-monitor="home_help_freshman">
                            <a target="_blank" href="#" rel="nofollow">用户注册</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">用户登录与密码找回</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">购买指南</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">支付方式</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">配送与说明</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_help">售后服务 </dt>
                        <dd data-monitor="home_help_help">
                            <a target="_blank" href="#">7 日无理由退货</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">质量问题 15 日内换货</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">保修条款</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">服务流程</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">安迷之家</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_guide">特色服务 </dt>
                        <dd data-monitor="home_help_guide">
                            <a target="_blank" href="#" rel="nofollow">F码通道</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">免费试用</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">360 生态</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">一元夺宝</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_tuiguang">推广合作 </dt>
                        <dd data-monitor="home_help_try">
                            <a target="_blank" href="#" rel="nofollow">商品入驻</a>
                        </dd>
                        <dd>
                            <a target="_blank" href="#" rel="nofollow">大客户采购</a>
                        </dd>
                    </dl>
                    <dl class="foot-con"> <dt data-monitor="home_foot_try">关注360商城 </dt>
                        <dd data-monitor="home_help_try">
                            <a target="_blank" href="#" rel="nofollow">360商城大事记</a>
                        </dd>
                    </dl>

                </div>
            </div>
            <div class="footer-copyright">冰雨商城 ©2016-2018 BYCMS工作室版权所有 京ICP备000001号-43</div>
        </div>
        <!--尾部结束-->

        <!--右边底部返回顶部-->
        <div class="slidebar" id="slidebar">
            <ul>
                <li class="topback">
                    <a href="javascript:;"></a>
                </li>
            </ul>
        </div>
        <!--右边底部返回顶部结束-->

</body>

</html>